]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
background: always add content to cache
authorRay Strode <rstrode@redhat.com>
Fri, 22 Mar 2013 19:01:29 +0000 (15:01 -0400)
committerRay Strode <rstrode@redhat.com>
Tue, 26 Mar 2013 21:02:04 +0000 (17:02 -0400)
We currently only add the first instance of a background
to the cache.  This means if the actor associated with that
background is destroyed, the content will be evicted and
it will need to get reloaded, even if it's already loaded
on another actor.

This commit ensures every content gets added to the cache.

https://bugzilla.gnome.org/show_bug.cgi?id=696157

js/ui/background.js

index 0672dd14e669a73ece0d272a4a9fae9f1229d628..aa238e7412a38017624ef1db7ee7eb64ab562830 100644 (file)
@@ -84,10 +84,10 @@ const BackgroundCache = new Lang.Class({
             } else {
                 content.load_gradient(params.shadingType, params.color, params.secondColor);
             }
-
-            this._patterns.push(content);
         }
 
+        this._patterns.push(content);
+
         return content;
     },
 
@@ -165,6 +165,8 @@ const BackgroundCache = new Lang.Class({
 
             if (params.cancellable && params.cancellable.is_cancelled())
                 content = null;
+            else
+                this._images.push(content);
 
             if (params.onFinished)
                 params.onFinished(content);